LL(1) Conflict Resolution in a Recursive Descent Compiler Generator
نویسندگان
چکیده
Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead. In this paper we suggest a systematic technique for resolving LL(1) conflicts in recursive descent parsing and show how to integrate it into a compiler generator (Coco/R). The idea is to evaluate user-defined boolean expressions, in order to allow the parser to make its parsing decisions where a one symbol lookahead does not suffice. Using our extended compiler generator we implemented a compiler front end for C# that can be used as a framework for implementing a variety of tools.
منابع مشابه
LL ( 1 ) Conflict Resolution in a Recursive Descent Compiler Generator 1
Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead. In this paper we suggest a syst...
متن کاملTaurus, a Parser Generator Producing Error Recovering Parsers in Scheme
A parser generator producing recursive descent LL(1) parsers was implemented. The generated parsers include automatic syntactic error recovery and error reporting. The i mplementation language for both the parser generator and the generated parsers is Scheme.
متن کاملEfficient and Comfortable Error Recovery in Recursive Descent Parsers
This paper describes the interesting features of the recursive descent parser generator Ell from the user’s point of view. Some of the interesting implementation aspects are discussed. The generated parsers are extremely fast and run at speed of 55,000 tokens per second or 900,000 lines per minute on a MC 68020 processor. The outstanding features of Ell are the L-attribution mechanism, its abil...
متن کاملANTLR: A Predicated- LL(k) Parser Generator
Despite the parsing power of LR=LALR algorithms, e.g. YACC 1, programmers often choose to write recursive-descent parsers by hand to obtain increased flexibility, better error handling, and ease of debugging. We introduce ANTLR, a public-domain parser generator that combines the flexibility of hand-coded parsing with the convenience of a parser generator, which is a component of PCCTS 2. ANTLR ...
متن کاملPractical Packrat Parsing
A considerable number of research projects are exploring how to extend object-oriented programming languages such as Java with, for example, support for generics, multiple dispatch, or pattern matching. To keep up with these changes, language implementors need appropriate tools. In this context, easily extensible parser generators are especially important because parsing program sources is a ne...
متن کامل